﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;

namespace hse_2013_e_booking
{
    public partial class Outcome : Form
    {
        public Outcome()
        {
            InitializeComponent();
        }

        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            try
            {

                Process.Start("mailto:asasa-asasa@ya.ru?subject=Отдых"+"&body="
                    + "Здравствуйте. Я выбрал вариант " + dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells[0].Value + " " + dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells[1].Value + " звёзд," + dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells[2].Value + ", стоимостью " + dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells[3].Value + " за ночь. Пожалуйста, свяжитесь со мной.");
            }
            catch { };
        }

        private void Outcome_FormClosing(object sender, FormClosingEventArgs e)
        {
            
            BookForm book = this.Owner as BookForm;
            if (book != null)
            {               
            }
            book.Show();
        }

        private void Outcome_Load(object sender, EventArgs e)
        {
            if (dataGridView1.Rows.Count == 0) { dataGridView1.Hide(); notice.Show(); } else { dataGridView1.Show(); notice.Hide(); };
        }
    }
}
